package org.redmagic.client.location;

import java.net.URI;

import org.redmagic.client.api.Location;

public abstract class AbstractLocation implements Location {
	
	private final String name;
	
	private final URI uri;
	
	public AbstractLocation(String name, URI uri) {
		this.name = name;
		this.uri = uri;
	}
	
	@Override
	public String getName() {
		if (name == null) {
			return this.getClass().getSimpleName() + " [" + uri.toString() + "]";
		} else {
			return name;
		}
	}
	
	@Override
	public URI getUri() {
		return uri;
	}
}
